package com.example.demo5072.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * @author lzh
 * @date 2019/7/30 - 10:13
 */
@Configuration
@MapperScan("com.example.demo5072.mapper")
public class MybatisPlusConfig {

    @Bean
    public PaginationInterceptor  paginationInterceptor(){
        return  new PaginationInterceptor();
    }


    @Bean
    public PerformanceInterceptor performanceInterceptor(){
        PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
        //格式化sql语句
        Properties properties = new Properties();
        properties.setProperty("format","false");
        performanceInterceptor.setProperties(properties);
        return performanceInterceptor;
    }






























}
